package com.socked;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.util.Scanner;

public class client {
  public static void main(String[] args) throws IOException, ClassNotFoundException {
    Socket socket = new Socket("127.0.0.1", 8888);
    System.out.println("连接成功");
    ObjectInputStream in = new ObjectInputStream(socket.getInputStream());
    ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());
    response r = (response)in.readObject();
    System.out.println(r.getMsg());
    Scanner sc = new Scanner(System.in);

    while(true){


      System.out.print("你说：");
      String msg = sc.next();
      out.writeObject(new request(msg));


    }




  }
}
